package com.corpgovernment.common.base;

import com.corpgovernment.common.common.CorpBusinessException;
import com.corpgovernment.common.enums.ExceptionCodeEnum;
import com.ctrip.corp.obt.generic.exception.ResponseStatus;
import lombok.Data;

@Data
@Deprecated
public class CommonException extends CorpBusinessException {

    public CommonException() {
        super(ExceptionCodeEnum.Alert,"系统异常");
    }

    public CommonException(String errMsg) {
        super(ExceptionCodeEnum.Alert, errMsg);
    }
    // todo 防止这个构造器有调用，先保留这个方法
    public CommonException(Integer errCode, String errMsg) {
        super(ExceptionCodeEnum.Alert, errMsg);

    }

    public CommonException(ResponseStatus status) {
        super(status);
    }

    @Override
    public String toString() {
        return "CommonException{" +
                "errMsg='" + super.getMessage() + '\'' +
                "errCode='" + super.getResultCode() + '\'' +
                '}';
    }


    public String getErrMsg(){
        return getMsg();
    }
    public Integer getErrCode(){
        return getResultCode();
    }
}
